package com.tebiecloud.api.gateway.server.filter.context;

import lombok.Data;
import lombok.Getter;
import org.springframework.http.HttpHeaders;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

/**
 * 网关数据上下文
 * @Author: tebie
 * @Date: 2019-08-09 08:46
 */
@Data
public class GatewayContext {

    public static final String CACHE_GATEWAY_CONTEXT = "cacheGatewayContext";

    /**
     * 请求消息体，json格式
     */
    private String requestBody;

    /**
     * 响应消息体
     */
    private Object responseBody;

    /**
     * 请求头
     */
    private HttpHeaders requestHeaders;

    /**
     * 表单数据
     */
    private MultiValueMap<String, String> formData;

    /**
     * 所有数据，包含表单与参数
     */
    private MultiValueMap<String, String> allRequestData = new LinkedMultiValueMap<>(0);

}
